package com.ruoyi.attachment.service;


import com.ruoyi.attachment.domain.Attachment;

import java.util.List;

/**
 * 附件Service接口
 *
 * @author ruoyi
 * @date 2022-05-18
 */
public interface IAttachmentService
{
    /**
     * 查询附件
     *
     * @param attachmentId 附件主键
     * @return 附件
     */
    public Attachment selectAttachmentByAttachmentId(Long attachmentId);

    /**
     * 查询附件列表
     *
     * @param attachment 附件
     * @return 附件集合
     */
    public List<Attachment> selectAttachmentList(Attachment attachment);

    /**
     * 新增附件
     *
     * @param attachment 附件
     * @return 结果
     */
    public int insertAttachment(Attachment attachment);

    /**
     * 修改附件
     *
     * @param attachment 附件
     * @return 结果
     */
    public int updateAttachment(Attachment attachment);

    /**
     * 批量删除附件
     *
     * @param attachmentIds 需要删除的附件主键集合
     * @return 结果
     */
    public int deleteAttachmentByAttachmentIds(Long[] attachmentIds);

    /**
     * 删除附件信息
     *
     * @param attachmentId 附件主键
     * @return 结果
     */
    public int deleteAttachmentByAttachmentId(Long attachmentId);

    /**
     * 删除服务器附件
     * @param filePath
     */
    void deleteServerFile(String filePath);

    /**
     * 公用附件上传方法
     * @param attachment
     */
    int uploadServerFile(Attachment attachment,String tableName);


    void deleteAttachmentByAttachmentName(String attachmentName);
}
